﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cemit.NetFramework
{
    /// <summary>通用异步操作回执</summary>
    public struct AsyncReport
    {
        /// <summary>表示该操作是否成功</summary>
        public bool isSucceed;

        /// <summary>该操作的输出</summary>
        public string output;

        /// <summary>根据传入的布尔值，自动将output填充为"success"或"fail"</summary>
        public AsyncReport(bool isSuccessful)
        {
            this.isSucceed = isSuccessful;
            output = isSuccessful ? "success" : "fail";
        }

        public AsyncReport(bool isSuccessful, string output)
        {
            this.isSucceed = isSuccessful;
            this.output = output;
        }
    }
}
